package esputnik;

public class TimeInterval {

	public String blockToTime(int blockStart, int blockEnd) {
		return convertToBlockTime(blockStart) + " - " + convertToBlockTime(blockEnd);
	}

	private String convertToBlockTime(int block) {
		int day = (block - 1) / 96 ;
		int dayTime = (block - 1) % 96 ;
		
		int dayTimeHours = dayTime / 4 ;
		int dayTimeMinuts = (dayTime % 4) * 15;
		
		String[] days = {"Понедельник","Вторник", "Среда", "Четверг", "Пятница", "Субота", "Воскресенье"};
		
		return String.format(" %1$s %2$02d:%3$02d", days[day] , dayTimeHours, dayTimeMinuts);
	}
	

}
